package com.xjscrm.console.web.list;

import com.xjscrm.console.param.BaseDto;
import com.xjscrm.console.param.list.BatchDeleListDto;
import com.xjscrm.console.param.list.KickingLanguageSkillDto;
import com.xjscrm.console.param.list.WwCustomerListQuery;
import com.xjscrm.console.param.list.WwCustomerWhiteDto;
import com.xjscrm.console.service.customer.list.BatchListService;
import com.xjscrm.console.service.customer.list.WhiteListService;
import com.xjscrm.console.vo.WwCustomerBlackVo;
import com.xjscrm.console.vo.WwCustomerVo;
import com.xjscrm.console.vo.WwCustomerWhiteVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.PublicKey;

@Api(value = "白名单管理", tags = "白名单管理")
@RestController
@RequestMapping(value = "/whilelist")
public class WhiteListController {


    @Autowired
    private WhiteListService whileListService;

    @Autowired
    private BatchListService batchListService;

    @ApiOperation(value = "新增白名单", notes = "新增白名单",response = Boolean.class)
    @PostMapping(value ="/addWhileList" )
    public Object addWhileList(@RequestBody WwCustomerWhiteDto wwCustomerWhiteDto)throws Exception{
        batchListService.addWhileList(wwCustomerWhiteDto);
        return true;
    }

    @ApiOperation(value = "获取白名单列表", notes = "获取白名单列表",response = WwCustomerWhiteVo.class)
    @PostMapping(value ="/getWhiteList" )
    public Object getWhiteList(@RequestBody WwCustomerListQuery wwCustomerListQuery)throws Exception{
        return whileListService.getWhiteList(wwCustomerListQuery);
    }

    @ApiOperation(value = "批量删除白名单", notes = "批量删除白名单",response = Boolean.class)
    @PostMapping(value ="/batchDeleWhiteList" )
    public Object batchDeleWhiteList(@RequestBody BatchDeleListDto batchDeleListDto)throws Exception{
        batchListService.batchDeleWhiteList(batchDeleListDto);
        return true;
    }

    @ApiOperation(value = "新增踢人话术", notes = "新增踢人话术",response = Boolean.class)
    @PostMapping(value ="/addKickingLanguageSkill" )
    public Object addKickingLanguageSkill(@RequestBody KickingLanguageSkillDto languageSkillDto)throws Exception{
        whileListService.addKickingLanguageSkill(languageSkillDto);
        return true;
    }

    @ApiOperation(value = "查询踢人话术", notes = "查询踢人话术",response = Boolean.class)
    @PostMapping(value ="/getKickingLanguageSkill" )
    public Object getKickingLanguageSkill(@RequestBody BaseDto baseDto)throws Exception{
      return    whileListService.getKickingLanguageSkill(baseDto);

    }
}
